var h;
var w;
$(function() {
    h = $(document).height(); //获得当前窗口高度
    w = $(document).width(); //获得当前窗口宽度
    /* 判断是否为空 是则返回0 否则返回原数组 */

    //根据当前窗口大小 调整弹出框是否需要最大化

})

function isZero(d) {
    if (d == null || d == undefined || isNaN(d) || d == "") {
        return 0;
    } else {
        return d;
    }
}

function area(a, b) {

    if (a <= w) {
        a = a + 'px';
    } else {
        a = '100%';
    }
    if (b <= h) {
        b = b + "px";
    } else {
        b = "100%";
    }

    return [a, b];
}

function isred(d, x) {
    if (parseInt(d) == 0) {
        return x
    } else {
        return '<span style="color:red">' + x + '</span>'
    }

}
//true or false
function isfk(str) {
    if (str == "" || str == null || str == undefined) {
        return true;
    } else {
        return false;
    }
}
//添加0
function addzreo(a) {
    if (a < 10) {
        a = "0" + a;
    }
    return a;
}

function A(d) {
    var title1;
    switch (parseInt(d)) {
        case 1:
            title1 = "新签客户"
            break;
        case 2:
            title1 = "收集事务"
            break;
        case 3:
            title1 = "发放事务"
            break;
        case 4:
            title1 = "调整事务"
            break;
        case 5:
            title1 = "停止事务"
            break;
        case 6:
            title1 = "其他事务"
            break;
        default:

            break;
    }
    return title1;
}